from flask import Flask, render_template, request

app = Flask(__name__)


#

#

# @app.route('/')

# def hello_world():

#     return 'Hello World!!!'
#

#
# @app.route('/index')
# def fun_index():
#     # return '学习flask'
#     str1 = '变量1'
#     list1 = ['嘻嘻', '哈哈', '呵呵']
#     return render_template('index.html', str1=str1, lists=list1)
#

# @app.route('/')
# def index():
#     return render_template('login.html')


@app.route('/login', methods=['post'])
def login():
    user_info ={}
    user_id = request.form.get('user_id')
    user_pw = request.form.get('user_pw')
    print(user_id)
    print(user_pw)
    for key in user_info:
        if user_id in user_info.keys():
            if  user_pw == user_info[user_pw]:
                return '登陆成功'
            else:
                return render_template('login.html', relogin='登录失败，账号或者密码错误！')


if __name__ == '__main__':
    app.run(debug=True)
